-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Explain why the Web Debug Toolbar is gone #8934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When rendering a response using a template, the Web Debug Toolbar is gone, which was confusing to me. Only after searching I found the reason: there is no body element when using this rendering method. It seems logical to me to also explain extending a template to incorporate base.html.twig, so the Toolbar re-appears.
page_creation.rst
Outdated
@@ -262,6 +262,20 @@ to get your *new* lucky number! | |||
|
|||
http://localhost:8000/lucky/number | |||
|
|||
Now you may wonder where the Web Debug Toolbar has gone: that's because we don't write | |||
a ``body`` element using the current template. If we incorporate the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a body element
-> a <body> HTML tag
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though, strictly speaking, a tag is not an element, and I guess the element should be present, not only an opening tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, only </body>
have to be present. Not even a complete body element.
Strictly speaking there is a body element (The node in a DOM tree), which consists of an open and close tag.
In any case, let's be explict here and say "that's because there is no </body>
tag in the current template. You can add the body element yourself, or extend base.html.twig
, which contains all default HTML elements." (also removing first person usage)
If you agree, can you please update your PR (otherwise, just comment back)? Thanks!
Even if this fix is correct, I'd love to fix this differently. The fact that the debug toolbar needs a |
In that case I'd simply copy the base template, so you at least create a valid HTML page. I don't know about another solution, but I'm also just learning Symfony. |
Looks good! (except from the minor issue that we add line breaks after the first word crossing the 72th character, but we can fix it during the merge) 👍 Thanks! status: reviewed |
@marcelkorpel thanks for this improvement and congrats on your first Symfony Docs contribution! |
…javiereguiluz) This PR was merged into the 4.0 branch. Discussion ---------- Explain why the Web Debug Toolbar is gone When rendering a response using a template, the Web Debug Toolbar is gone, which was confusing to me. Only after searching I found the reason: there is no body element when using this rendering method. It seems logical to me to also explain extending a template to incorporate base.html.twig, so the Toolbar re-appears. Commits ------- b1cf487 Wrap long lines 0c272c3 Reword explanation 1c25c7c Explain why the Web Debug Toolbar is gone
When rendering a response using a template, the Web Debug Toolbar is gone, which was confusing to me. Only after searching I found the reason: there is no body element when using this rendering method. It seems logical to me to also explain extending a template to incorporate base.html.twig, so the Toolbar re-appears.